package com.hmall.mapper;

import com.hmall.model.MallPrice;
import com.hmall.util.MyMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;
@Repository
public interface MallPriceMapper extends MyMapper<MallPrice> {
    MallPrice selectPriceNum(@Param(value = "productId") Integer productId, @Param(value = "weight") BigDecimal weight, @Param("grade") String grade);
    //取那样单价
    MallPrice selectPriceNumSample(@Param(value = "productId") Integer productId, @Param("grade") String grade);
    List<MallPrice> findPriceList(@Param("productId") Integer productId);


    List<String> findGradeListByProductId(@Param("productId") Integer productId);

    List<String> findGradeListByProductIdStr(@Param("list") List productId);

    List<MallPrice> findPriceAndGradeList(@Param("productId") Integer productId, @Param("grade") String grade);

    List<MallPrice> findPriceListByProductIdAndGrade(@Param("productId") Integer productId, @Param("grade") String grade);

    void deleteByProductId(Integer product_id);




}